//
//  BottomBtnView.m
//  BUS
//
//  Created by  程 强 on 15/9/15.
//  Copyright (c) 2015年 cl. All rights reserved.
//

#import "BottomBtnView.h"
#import "df.h"
#import "UILabel+Custom.h"

#import "JTCSM.h"
@implementation BottomBtnView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}

- (id)initWithFrame:(CGRect)frame title:(NSString *)title imageName:(NSString *)imgname{
    self = [self initWithFrame:frame];
    if (self) {
        CGFloat space = 15;
        CGFloat imageWidth = frame.size.height-2*space -20;
        self.imgView = [[UIImageView alloc]initWithFrame:CGRectMake((frame.size.width-imageWidth)/2, space, imageWidth, imageWidth)];
        self.imgView.image = [UIImage imageNamed:imgname];
        self.imgView.contentMode =UIViewContentModeScaleAspectFit;
        self.imgView.userInteractionEnabled = YES;
        [self addSubview:self.imgView];
        
        self.label = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(self.imgView)+12, frame.size.width, 20) text:title font:13 textAlignment:NSTextAlignmentCenter texcolor:RGBACOLOR(89, 89, 89, 1) backgroundColor:nil];
        self.label.userInteractionEnabled = YES;
        [self addSubview:self.label];
        
        self.backgroundColor = [UIColor whiteColor];
    }
    return self;
}
@end
